package com.lishe.lishe.lishe.common;

import com.lishe.lishe.lishe.base.BaseApplication;
import com.lishe.lishe.lishe.utils.SharedPreferencesUtils;

/**
 * Created by lwa on 2017/8/9.
 * 全局常量
 */

public class Globals {

    /**
     * 当前版本号 V220
     */
    public static final String VERSIONNAME = "V220";

    /**
     * debug开关
     */
    public static boolean DEBUG= true;

    /**
     * 刷新区分
     */
    public static final int TYPE_LoadMore = -99;
    public static final int TYPE_Refresh = -98;
    public static final int TYPE_Edit = -97;
    public static final int TYPE_Condition = -96;

    public static final String key = "lishe_md5_key_56e057f20f883e";

    public static final String WeiXin_appId = "wx2d7d684bdd4f703a";
    public static final String WeiXin_secret = "9383996cf51110aca991ea1a757abfa8";
    public static final String QQ_appId = "1106267895";
    public static final String QQ_appKey = "VOdhFHxIQwgARpBC";

    /**
     * 广播action
     */
    public static final String ACTION_UPADDRESS = "up_address";
    public static final String ACTION_FINISH_ALL_ACTIVITY = "finish_all_activity";
    /**
     * url集合
     */
    //关于礼舍
    public static final String URL_ABOUT_LISHE = "http://www.lishe.cn/mobile?from=app";
    public static final String URL_GIFT_RECOR_SERCH = "http://api.lishe.cn/index.php/Giftrecord/search";

    /**
     * 请求码
     */
//    public static final int RESULT_CODE = 1000;
    public static final int REQUSE_CODE_PayActivity = 1001;
    public static final int REQUSE_CODE_RechargeIntegralActivity = 1002;
    public static final int REQUSE_CODE_AddAddrActivity = 1003;
    public static final int REQUSE_CODE_AddressManageActivity = 1004;
    public static final int REQUSE_CODE_ConfirmOrderActivity = 1005;
    public static final int REQUSE_CODE_ImageSelectorActivity = 1006;
    public static final int REQUSE_CODE_SelectGiftActivity = 1007;
    public static final int REQUSE_CODE_VisualRangeActivity = 1008;
    public static final int REQUSE_CODE_DianZanReasonActivity = 1009;
    public static final int REQUSE_CODE_DianZanPersonActivity = 1010;
    public static final int REQUSE_CODE_SelectPersonActivity = 1011;
    public static final int REQUSE_CODE_SearchActivity = 1012;
    /**
     * 订单有6种状态
     */
    public static final int ORDER_TYPE_ALL = 0;
    public static final int ORDER_TYPE_WAIT_PAY = 1;
    public static final int ORDER_TYPE_WAIT_SEND = 2;
    public static final int ORDER_TYPE_WAIT_RECEIVE = 3;
    public static final int ORDER_TYPE_OVER = 4;
    public static final int ORDER_TYPE_COME_BACK = 5;
    /**
     * 商城状态有6种状态
     */
    public static final int MALL_TYPE_ALL = 0;
    public static final int MALL_TYPE_HOME_ELETRICAL = 1;//家电
    public static final int MALL_TYPE_HOME_FURNISHING = 2;//家居
    public static final int MALL_TYPE_HEALTH = 3;//养生
    public static final int MALL_TYPE_TRAVEL = 4;//旅行（鞋箱服）
    public static final int MALL_TYPE_CLEANING = 5;//清洁用品
    /**
     * 礼舍电话
     */
//    public static final String LISHE_PHONE = "400-118-8234";
    public static final String LISHE_PHONE = "0755-32914642";
    /**
     * 登陆的token
     */
//    public static final String TOKEN = "59a399e255e85b49a2fe82f8bc342e08";
    //------------------------------------------app接口-------------------------------------------------
    //测试接口
    public static final String LISHE_URL_TEST = "http://new.s.lishe.cn/index.php/";
    //新的正式环境
    public static final String LISHE_URL_FORMAL_U = "http://app.lishe.cn/";
    //App UAT环境
    public static final String LISHE_URL_UAT = "http://api.lishe.cn/newapi.php/";

    // APP使用接口
    public static final String LISHE_URL = LISHE_URL_TEST;

    //----------------------------一企一舍接口---------------------------------------
    //测试接口
    public static final String LISHE_URL_EXCITATION_TEST = "http://120.76.159.44:8080/";
    //一企一舍正式环境
    public static final String LISHE_URL_EXCITATION_U = "https://v.lishe.cn/";
    //UAT环境
    public static final String LISHE_URL_EXCITATION_UAT = "https://uatv.lishe.cn/";

    // APP使用接口
    public static final String LISHE_URL_EXCITATION = LISHE_URL_EXCITATION_TEST;

    //--------------------------------------------------------------------------------

    //激励模块-接口key
    public static final String KEY_EXCITATION = "lishe_md5_key_56e057f20f883e";

    //礼舍文件夹路径
    public static final String LISHE_FILE = CommonUtils.getSDPath() + "/lishe";
    //sharepreferences

    //SP用户信息相关
    public static String SHAREPREFERENCES_USER = "share_lishe";
    //SP应用基础相关
    public static String SHAREPREFERENCES_BASE = "share_lishe";

    //礼舍文件夹路径
    public static final String APK_NAME = "lishe.apk";
    //app包名
    public static final String APP_PACKAGE = "com.lishe.lishe";
    public static final int ADD_ADRESS = 1;
    public static final int UPDATE_ADRESS = 2;

    /**
     * 获取内存里面的token
     */
    public static String getToken() {
        String token = SharedPreferencesUtils.getToken(BaseApplication.getContext());
        return token;
    }

    /**
     * 获取内存里面的token
     */
    public static String getExcatationUserId() {
        String token = SharedPreferencesUtils.getExcitationUserId(BaseApplication.getContext());
        return token;
    }
}
